//
//  RepairScheduledViewController.m
//  Project6
//
//  Created by ToanDK on 11/15/12.
//  Copyright (c) 2012 DungNP. All rights reserved.
//

#import "RepairScheduledViewController.h"
#import "ScheduledRepairDetailViewController.h"

@interface RepairScheduledViewController ()

@end

@implementation RepairScheduledViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
     self.title =@"Repair";
    [tabbar setSelectedItem:scheduledItem];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
{
    if (item.tag == 0)
    {
        [self.navigationController popViewControllerAnimated:YES];
    }
}
#pragma mark -
#pragma mark Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    // Only one section.
    return 1;
}

// show tile for section
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    return @"Scheduled repair";
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    // Only one section, so return the number of items in the list.
    //return [dataController countOfList];
    return 5;
}



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
	static NSString *CellIdentifier = @"TestCell";
	
	UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    
    if(cell ==nil)
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
    }
    
    // Get the object to display and set the value in the cell.
    //Play *playAtIndex = [dataController objectInListAtIndex:indexPath.row];
    cell.textLabel.text = @"WTG AA(DAVE ID)";
    cell.detailTextLabel.text =@"Sub text";
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    // go to detail scheduled repair screen
    ScheduledRepairDetailViewController * scheduledRepairDetail = [[ScheduledRepairDetailViewController alloc] initWithNibName:@"ScheduledRepairDetailViewController" bundle:nil];
    [self.navigationController pushViewController:scheduledRepairDetail animated:YES];
    
}

// show arrow at end to row
- (UITableViewCellAccessoryType)tableView:(UITableView *)tv accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath {
    return UITableViewCellAccessoryDisclosureIndicator;
}


@end
